/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.doc.sender.ui;

import java.awt.*;
import java.util.ArrayList;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author parent
 */
public class StatusBar extends JPanel {
    private int count;
    private ArrayList<String> bartext;

    public void setArrayBarText(ArrayList<String> bartext) {
        this.bartext = bartext;
        for (String s: bartext){
            this.add(new JLabel(s));
        }
    }
    private JLabel simple;
    /** Creates a new instance of StatusBar */
    public StatusBar(ArrayList<String> barText){
        super();
        this.bartext=barText;
        for (String s: bartext){
            this.add(new JLabel(s),java.awt.BorderLayout.WEST);
        }
        //super.setPreferredSize(new Dimension(100, 20));
        
    }
    public StatusBar(String simpleText) {
        super();
        super.setPreferredSize(new Dimension(100, 20));
        
        super.setLayout(new FlowLayout());
        simple=new JLabel(simpleText);
        simple.setLocation(0, 0);
        this.add(simple,java.awt.BorderLayout.WEST);
        setMessage(simpleText);
    }
    public String getStatusBarText(){
        if (simple!=null) {
            return simple.getText();
        } else {
            return bartext.toString();
        }
    }
    public void setMessage(String message) {
        simple.setText(" "+message);        
    }  
}
